package com.demo.celue;

public class Context {

	private CashSuper cashSuper;
	
	public Context(int type){
		switch (type) {
		case 1:
			cashSuper=new CashNormal();
			break;
		case 2:
			cashSuper=new CashRebate(0.8d);
			break;
		case 3:
			cashSuper=new CashReturn(500,100);
			break;
		default:
			break;
		}
	}
	
	public double acceptCash(double money){
		return cashSuper.acceptCash(money);
	} 
}
